package com.example.dense_rack_server.mapper;

import com.example.dense_rack_server.entity.ArchivesType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.dense_rack_server.entityVo.MenuALLVo;
import com.example.dense_rack_server.entityVo.MyAreaTreeVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 档案分类 Mapper 接口
 * </p>
 *
 * @author  张彬 
 * @since 2025-03-03
 */
public interface ArchivesTypeMapper extends BaseMapper<ArchivesType> {
    /**
     * 绘制分类树
     */
    @Select("select d.id as id,d.parent_id as parentId ,d.type_name as title from archives_type as d")
    List<MyAreaTreeVo> buildType();

    /**
     * 绘制分类树
     */
    @Select("select d.id as id,d.parent_id,d.type_name as title from archives_type as d where d.status = 1 order by d.sort")
    List<MenuALLVo> buildTypeTree();


    /**
     * 获取近六个月分类
     */
    List<ArchivesType> getInThePast6Months();
}
